import base64 as b64
# 中文转base64
str1 = b"hello"
encoded_str = b64.b64encode(str1).decode('UTF-8')
print(encoded_str)


tmpBytes = b64.b64decode(encoded_str)
tmpStr = tmpBytes.decode()
print(tmpStr)


# tmpBytes = b64.b64decode('9awIDpTTx3Uv3OSN+dfzey')
# tmpStr = tmpBytes.decode(encoding='utf-8')
# print(tmpStr)